/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.una.accidentmanagement.model;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;

@Entity
public class Ticket implements Serializable {

    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    private Long id;
    
    @ManyToOne    
    private Requester requester;
    
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date created;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date updated;
    private String description;    
    @ManyToOne    
    private Service service;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date closed;
    private int priority;
    private int level;        
    private Status status;
    @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)    
    private List<ActionTicket> actions;
    @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    private List<TicketFile> ticketFiles;
    private Attendant lastAttendant;

    public List<TicketFile> getTicketFiles() {
        return ticketFiles;
    }

    public void setTicketFiles(List<TicketFile> ticketFiles) {
        this.ticketFiles = ticketFiles;
    }
    

    
    public List<ActionTicket> getActions() {
        return actions;
    }

    public void setActions(List<ActionTicket> acao) {
        this.actions = acao;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Requester getRequester() {
        return requester;
    }

    public void setRequester(Requester requester) {
        this.requester = requester;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getUpdated() {
        return updated;
    }

    public void setUpdated(Date updated) {
        this.updated = updated;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Service getService() {
        return service;
    }

    public void setService(Service service) {
        this.service = service;
    }

    public Date getClosed() {
        return closed;
    }

    public void setClosed(Date closed) {
        this.closed = closed;
    }

    public int getPriority() {
        return priority;
    }

    public void setPriority(int priority) {
        this.priority = priority;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    /**
     * @return the lastAttendant
     */
    public Attendant getLastAttendant() {
        return lastAttendant;
    }

    /**
     * @param lastAttendant the lastAttendant to set
     */
    public void setLastAttendant(Attendant lastAttendant) {
        this.lastAttendant = lastAttendant;
    }
}
